package com.whynot.frame.designMode.observe.main;

import com.whynot.frame.designMode.observe.base.Observer;
import com.whynot.frame.designMode.observe.impl.Concrete2Observer;
import com.whynot.frame.designMode.observe.impl.ConcreteObserver;
import com.whynot.frame.designMode.observe.impl.ConcreteSubject;

public class Client {
	
	public static void main(String[] args) {
		/**
		 * 定义一个被观察者
		 */
		ConcreteSubject subject = new ConcreteSubject();
		/**
		 * 顶一个具体的观察者
		 */
		Observer observer = new ConcreteObserver();
		Observer observer2 = new Concrete2Observer();
		
		/**
		 * 添加观察者
		 */
		subject.addObserver(observer);
		subject.addObserver(observer2);
		
		/**
		 * 被观察者开始活动
		 */
		subject.dosomething();
	}
}
